#include <stdio.h>

int main(void)
{
	int i, j, k, m, n;

	for (i = 1; i <= 9; i++)
		for (j = 0; j <= 9; j++)
			for (k = 0; k <= 9; k++)
			{
				m = i * 100 + j * 10 + k;
				n = i * i * i + j * j * j + k * k * k;
				if (m == n)
					printf("%5d", m);
			}
	printf("\n");

	return 0;
}